# 此处是测试的脚本 非该项目脚本
FROM node:12.22.5-alpine3.14

WORKDIR /app
COPY package.json index.js ./
RUN npm install
EXPOSE 3000

CMD ["npm", "start"]

# distroless 容器方案
# FROM node:8 as build

# WORKDIR /app
# COPY package.json index.js ./
# RUN npm install

# FROM gcr.io/distroless/nodejs

# COPY --from=build /app /
# EXPOSE 3000

# CMD [ "index.js" ]



# 多阶段构建脚本
# FROM node:lts-alpine3.14 as build

# WORKDIR /app
# COPY package.json index.js ./
# RUN npm install

# FROM node:lts-alpine3.14

# COPY --from=build /app /
# EXPOSE 3000

# CMD ["index.js"]


# 原始脚本
# FROM node:8

# WORKDIR /app
# COPY package.json index.js ./
# RUN npm install

# EXPOSE 3000
# CMD ["npm", "start"]